<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
</head>
<style>
    .add_address {
        width: 100%;
        height: 3rem;
        background-color: #fff;
        text-align: center;
        color: #2780e8;
        font-size: 0.7rem;
        position: relative;
    }

    .add_address .add_btn {
        line-height: 3rem;
    }

    .add_address img {
        width: 100%;
        height: 0.2rem;
        position: absolute;
        left: 0;
        bottom: 0;
    }

    .add_address .add_address_title {
        color: #565656;
        font-size: 0.7rem;
        text-align: left;
        margin-left: 0.8rem;
        padding-top: 0.3rem;
    }

    .add_address .add_address_subtitle {
        text-align: left;
        margin-left: 0.8rem;
        color: #888;
        font-size: 0.6rem;
    }

    .fangan_detail {
        width: 100%;
        background-color: #fff;
        height: auto;
        border: 1px solid #ccc;
    }

    .fangan_detail .title {
        margin: 0.8rem 0;
        text-indent: 0.8rem;
        color: #303030;
        font-size: 0.7rem;
        font-weight: bold;
        /* display: inline-block; */
        width: 100%;
    }

    .fangan_detail .fangan_title {
        /* padding: 0.8rem; */
        margin: 0.8rem 0;
        text-indent: 0.8rem;
        color: #303030;
        font-size: 0.7rem;
        font-weight: bold;
    }

    .fangan_detail .yaocai {
        color: #565656;
        font-size: 0.7rem;
        /* padding: 0 0.8rem; */
        padding-left: 0.8rem;
        border-top: 1px solid #e8e8e8;
        border-bottom: 1px solid #e8e8e8;
    }

    .fangan_detail .yaocai .yaocai_item {
        display: inline-block;
        width: 34%;
        text-align: left;
        line-height: 2rem;
        height: 2rem;
    }

    .fangan_detail .drugs-number {
        width: 100%;
        height: auto;
        /* padding: 0 0.8rem; */
        text-indent: 0.8rem;
        display: inline-block;
    }

    .fangan_detail .drugs-number .numeric-name {
        display: inline-block;
        font-size: 0.7rem;
        width: 2.5rem;
        /* padding: 0.8rem 0.8rem 0.8rem 0; */
        margin: 0.8rem 0;
        text-indent: 0.8rem;
        float: left;
    }

    .fangan_detail .drugs-number .numeric {
        display: inline-block;
        font-size: 0.7rem;
        width: 11.8rem;
        /* padding: 0.8rem; */
        margin: 0.8rem 0;
        text-indent: 0.8rem;
        float: left;
        text-align: right;
    }

    .fangan_detail .detail_div {
        padding: 0 0.8rem;
    }

    .fangan_detail .detail_div .detail_div_item {
        height: 2.2rem;
        line-height: 2.2rem;
        width: 100%;
        background-color: #fff;
        border-bottom: 1px solid #e8e8e8;
        color: #565656;
        font-size: 0.7rem;
    }

    .fangan_detail .detail_div .detail_div_item span {
        color: #838383;
        font-size: 0.7rem;
        text-align: right;
    }

    .fangan_detail .detail_div .detail_div_item:last-child {
        border: none;
    }

    .yaofang_tuijian {
        background-color: #fff;
        padding: 0 0.8rem;
    }

    .yaofang_tuijian .yaofangtuijan_title {
        padding: 0.6rem 0;
        color: #303030;
        font-size: 0.7rem;
        font-weight: bold;
        border-bottom: 1px solid #e8e8e8;
    }

    .yaofang_tuijian .yaofang_item {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
    }


    .yaofang_item .yaofang_img {
        width: 2.3rem;
        height: 100%;
        padding: 0.5rem;
        display: inline-block;
        float: left;
    }

    .yaofang_item .yaofang_img img {
        margin: 0;
        padding: 0;
        width: 2.2rem;
        border-radius: 20rem;
    }

    .yaofang_item .store-show {
        float: right;
        width: 13.6rem;
    }

    .yaofang_item .store-show .yaofang_name {
        color: #565656;
        font-size: 0.7rem;
        margin-top: 0.2rem;
    }

    .yaofang_item .store-show .yaofang_info {
        font-size: 0.6rem;
        text-indent: 0.4rem;
        height: 1.38rem;
        padding: 0.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .yaofang_item .store-show .yaofang_useing {
        color: #838383;
        font-size: 0.7rem;
    }

    .yaofang_item .service {
        font-size: 0.7rem;
        font-weight: normal;
        padding: 0.4rem;
    }

    .yaofang_item .service span {
        border-radius: 0.2rem;
        padding: 0.2rem 0.5rem;
        margin-right: 0.2rem;
        border: 1px solid #e8e8e8;
        font-size: 0.7rem;
    }

    .yaofang_item .service-price {
        font-size: 0.7rem;
        font-weight: normal;
        padding: 0.2rem;
    }

    .yaofang_item .service-price span {
        color: #2780e8;
    }

    .yaofang_item .cur-daijian {
        background-color: #2780e8;
        color: #FFF;
    }

    .clearfix:after {
        content: "";
        display: table;
        height: 0;
        visibility: both;
        clear: both;
    }

    .submit_btn {
        height: 2rem;
        line-height: 2rem;
        background-color: #fff;
    }

    .submit_btn .address_none {
        color: #2780e8;
        font-size: 0.7rem;
        float: left;
        margin-left: 0.8rem;
        line-height: 2rem;
    }

    .submit_btn .submit {
        display: inline-block;
        width: 6rem;
        height: 2rem;
        text-align: center;
        line-height: 2rem;
        float: right;
        background-color: #2780e8;
        font-size: 0.7rem;
        color: #fff;
    }

    .pay_div {
        padding: 0 0.8rem;
        background-color: #fff;
    }

    .pay_div .pay_item {
        height: 3rem;
        line-height: 3rem;
        border-bottom: 1px solid #e8e8e8;
    }

    .pay_div .pay_item p {
        color: #838383;
        font-size: 0.7rem;
        margin-left: 0.8rem;
        float: left;
    }

    .pay_div .pay_item .icon {
        width: 1.3rem;
        height: 1.3rem;
        margin: 0.8rem 0 0 0;
        float: left;
    }

    .pay_div .pay_item .radio {
        width: 0.7rem;
        height: 0.7rem;
        float: right;
        margin: 1.2rem 0 0 0;
    }

    .detail_div_item:active {
        background-color: #f5f5f5;
    }
</style>

<body>
    <div  id="app" v-cloak>
        <div class="placeholder_div"></div>

        <!-- 有地址显示 -->
        <div class="add_address" v-if="address_total">
            <p class="add_address_title">{{address_total.name}} <span>{{address_total.phone}}</span></p>
            <p class="add_address_subtitle">{{address_total.areaInfo}} {{address_total.address}}</p>
            <img src="../image/line_img.png" alt="">
        </div>
        <!-- 没有地址的情况 -->
        <div class="add_address" v-else>
            <p class="add_btn">该患者无默认地址</p>
            <img src="../image/line_img.png" alt="">
        </div>

        <!-- 药房推荐 -->
        <div class="yaofang_tuijian">
            <p class="yaofangtuijan_title">发货药房</p>
            <div class="yaofang_item clearfix">
                <div class="yaofang_img"><img :src="image_http+storeLogo" alt=""></div>
                <div class="store-show clearfix">
                    <p class="yaofang_name">{{store}}</p>
                    <p class="yaofang_info">{{introduce}}</p>
                    <p class="service" v-if="ifdaijian">
                        <span :class="{'cur-daijian':changeColor == 0}" @click=daijianPrice(0)>免煎</span>
                        <span :class="{'cur-daijian':changeColor == 1}" @click=daijianPrice(1)>代煎</span>
                    </p>
                    <p class="service" v-if="((!ifdaijian) && ifservice)">
                        <span>加工条件:{{conditions.start_num}}起做</span>
                        <span>包装:{{conditions.package_type}}</span>
                    </p>
                    <p class="service-price" v-if="ifdaijian">代煎费:<span>￥{{daijian_price}}元</span></p>
                    <p class="service-price" v-else>加工费:<span>￥{{servicePrice}}元</span></p>
                    <p class="yaofang_useing">剂型：{{dosageForm}}</p>
                </div>
            </div>
        </div>
        <div class="placeholder_div"></div>
        <div class="fangan_detail" v-if="visible == 1">
            <div class="title">
                {{dosageForm}}(共{{prescription.length}}味药材)
            </div>
            <div class="yaocai">
                <div class="yaocai_item" v-for="item in prescription">
                    {{item}}
                </div>
            </div>
            <div class="drugs-number clearfix">
                <span class="numeric-name">帖数</span>
                <span class="numeric">{{quantity}}</span>
            </div>
        </div>
        <div class="placeholder_div" v-if="visible == 1"></div>

        <!-- 费用 -->
        <div class="fangan_detail">
            <p class="fangan_title">费用</p>

            <div class="detail_div">
                <div class="detail_div_item">
                    诊金
                    <span>￥{{zhenjin_on}}</span>
                </div>
                <div class="detail_div_item">
                    服务费
                    <span>￥{{service_money}}</span>
                </div>
                <div class="detail_div_item">
                    药费
                    <span>￥{{totalDrugsMoney}}</span>
                </div>
                <div class="detail_div_item" v-if="logisticsFee">
                    运费
                    <span>￥{{logisticsFee}}</span>
                </div>
                <div class="detail_div_item" v-else>
                    运费
                    <span>包邮</span>
                </div>
                <div class="detail_div_item" v-if="ifdaijian">
                    代煎费
                    <span>￥{{daijian_price}}</span>
                </div>
                <div class="detail_div_item" v-if="ifservice">
                    加工费
                    <span>￥{{servicePrice}}</span>
                </div>
                <div class="detail_div_item">
                    总价
                    <span>￥{{newTotal}}(不含运费)</span>
                </div>
                <div class="detail_div_item" v-if="logisticsFee">
                    应付金额
                    <span>￥{{payAmount}}(含运费)</span>
                </div>
                <div class="detail_div_item" v-else>
                    应付金额
                    <span>￥{{payAmount}}(包邮)</span>
                </div>
                <div class="detail_div_item" v-if="userPoint >= showNeedPoint">
                  抵扣￥{{deductionAmount}}元，需要积分{{showNeedPoint}}
                </div>
                <div class="detail_div_item" v-if="logisticsFee">
                    实付金额
                    <span  v-if="userPoint >= showNeedPoint">￥{{payAmount}}-￥{{deductionAmount}}=￥{{actualPayAmount}}(含运费)</span>
                    <span  v-else>￥{{actualPayAmount}}(含运费)</span>
                </div>
                <div class="detail_div_item" v-else>
                    实付金额
                    <span  v-if="userPoint >= showNeedPoint">￥{{payAmount}}-￥{{deductionAmount}}=￥{{actualPayAmount}}(包邮)</span>
                    <span  v-else>￥{{actualPayAmount}}(包邮)</span>
                </div>
            </div>
        </div>

        <div class="placeholder_div"></div>

        <div class="pay_div">

            <div class="pay_item" @click="pay = 'alipay'">
                <img class="icon" src="../image/icon_zfb.png" alt="">
                <p>支付宝支付</p>
                <img class="radio" v-if="pay == 'alipay'" src="../image/icon_radio_checked.png" alt="">
                <img class="radio" v-else src="../image/icon_radio.png" alt="">
            </div>

            <div class="pay_item" @click="pay = 'weixin'">
                <img class="icon" src="../image/icon_wx.png" alt="">
                <p>微信支付</p>
                <img class="radio" v-if="pay == 'weixin'" src="../image/icon_radio_checked.png" alt="">
                <img class="radio" v-else src="../image/icon_radio.png" alt="">
            </div>
        </div>

        <div class="placeholder_div"></div>

        <div class="submit_btn">
            <span class="address_none">￥{{actualPayAmount}}</span>
            <span class="submit" onclick="save()">确认订单</span>
        </div>
    </div>
</body>

</html>
<script src="../script/set_root.js"></script>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hb.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript">
    apiready = function () {
        hb_ready();
        for (var i = 0; i < api.pageParam.prescribeDrugs.length; i++) {
            app.prescription.push(api.pageParam.prescribeDrugs[i].name +
                api.pageParam.prescribeDrugs[i].quantity +
                api.pageParam.prescribeDrugs[i].unit)
        }
        app.prescribeDrugs = api.pageParam.prescribeDrugs
        app.zhenjin_on = api.pageParam.billingMoney
        app.service_money = api.pageParam.serviceMoney
        app.drugsPrice = api.pageParam.drugMoney
        app.total_money = api.pageParam.totalMoney
        app.newTotal = api.pageParam.totalMoney
        app.dosageForm = api.pageParam.dosageForm
        app.dosagePingyin = api.pageParam.dosagePingyin
        app.storeLogo = api.pageParam.storeLogo
        app.store = api.pageParam.store
        app.storeId = api.pageParam.storeId
        app.doctorId = api.pageParam.doctorId
        app.visible = api.pageParam.visible
        app.typeId = api.pageParam.typeId
        app.quantity = api.pageParam.quantity
        app.totalDrugsMoney = $api.toThreeDecimal(Number(api.pageParam.drugMoney) * Number(api.pageParam.quantity))
        get_moren_dizhi()
        get_store_service();
        get_store_info();

    }
    //使用vue对数据进行绑定
    var app = new Vue({
        el: '#app',
        data: {
            image_http: IMAGE_HTTP,
            prescription: [],
            prescribeDrugs: [],
            zhenjin_on: "",
            service_money: "",
            drugsPrice: 0.000,
            totalDrugsMoney: 0.000,
            total_money: "",
            dosageForm: "",
            dosagePingyin: "",
            storeLogo: "",
            store: "",
            introduce: "",
            pay: "alipay",
            doctorId: 0,
            typeId: 0,
            address_total: {},
            visible: 0,
            logisticsFee: 0,
            conditions: "",
            ifservice: false,
            ifdaijian: false,
            servicePrice: 0,
            djServicePrice:0,
            changeColor: 0,
            daijian_price: 0,
            newTotal: 0,
            payAmount: 0,
            actualPayAmount:0,
            userPoint: 0,
            deductionAmount: 0,
            needPoint: 0,
            showNeedPoint:0
        },
        methods: {
            daijianPrice: function ($val) {
                if ($val == 0) {
                    this.daijian_price = 0;
                    this.changeColor = 0;
                } else {
                    this.changeColor = 1;
                    this.daijian_price = app.djServicePrice ;
                }
            }
        },
        watch: {
            daijian_price: function (val) {
                app.newTotal = $api.toThreeDecimal(Number(app.daijian_price) + Number(app.total_money));
                if (Number(app.totalDrugsMoney) >= 80) {
                    app.payAmount = $api.toThreeDecimal(Number(app.daijian_price)  + Number(app.total_money));
                } else {
                    app.payAmount = $api.toThreeDecimal(Number(app.daijian_price)  + Number(app.total_money) + Number(app.logisticsFee));
                }
                //积分抵扣
                get_ajax("order/point-calculation",{
                  userId:api.pageParam.userId,
                  price: app.payAmount
                },function(rst,err){
                  if(rst.code == 200 && rst.data){
                    if(Number(rst.data.userPoint) >= Number(rst.data.needPoint)){
                      app.actualPayAmount = $api.toThreeDecimal(Number(app.payAmount) - Number(rst.data.deductionAmount))
                      app.actualPayAmount = app.actualPayAmount < 0 ? 0 : app.actualPayAmount
                      app.needPoint = rst.data.needPoint
                    }else{
                      app.actualPayAmount = Number(app.payAmount)
                      app.needPoint = 0
                    }
                    app.userPoint = rst.data.userPoint
                    app.deductionAmount = rst.data.deductionAmount
                    app.showNeedPoint = rst.data.needPoint
                  }
                });
            },

        }
    })
    function save() {
        if (app.address_total == "") {
            alert("您还不能为他购药，请先通知他添加一个默认地址吧")
        } else {
            if (!api.pageParam.planId) {
                toast("开方失败");
                return;
            }
            var decoctingFee = 0.000;
            //获取积分抵扣金额
            var a = {
                planType: "agency_buy",
                addressId: app.address_total.id,
                addressPhone: app.address_total.phone,
                addressConsignee: app.address_total.name,
                addressDetail: app.address_total.areaInfo + app.address_total.address,
                dosageForm: app.dosagePingyin,
                storeId: api.pageParam.storeId,
                storeName: api.pageParam.store,
                storeLogo: api.pageParam.storeLogo,
                planId: api.pageParam.planId,
                prescription: String(app.prescription),
                visible: api.pageParam.visible,
                billingMoney: api.pageParam.billingMoney,
                serviceMoney: api.pageParam.serviceMoney,
                drugMoney: api.pageParam.drugMoney,
                decoctingFee: app.daijian_price,
                processCost: app.servicePrice,
                quantity: app.quantity,
                totalMoney: app.newTotal,
                logisticsFee: app.logisticsFee,
                payChannel: app.pay,
                orderItemDtos: api.pageParam.prescribeDrugs,
                doctorId: $api.getStorage("emp").userId,
                doctor: $api.getStorage("emp").realname,
                department: $api.getStorage('doctor').department,
                userName: app.address_total.name,
                userPhone: app.address_total.phone,
                userId: api.pageParam.userId,
                deductPoints:app.needPoint,
                deductPointMoney:app.deductionAmount
            };
            var o = {
                planType: "agency_buy",
                addressId: app.address_total.id,
                addressPhone: app.address_total.phone,
                addressConsignee: app.address_total.name,
                addressDetail: app.address_total.areaInfo + app.address_total.address,
                dosageForm: app.dosagePingyin,
                storeId: api.pageParam.storeId,
                storeName: api.pageParam.store,
                storeLogo: api.pageParam.storeLogo,
                planId: api.pageParam.planId,
                prescription: String(app.prescription),
                visible: api.pageParam.visible,
                billingMoney: api.pageParam.billingMoney,
                serviceMoney: api.pageParam.serviceMoney,
                drugMoney: api.pageParam.drugMoney,
                decoctingFee: app.daijian_price,
                processCost: app.servicePrice,
                quantity: app.quantity,
                totalMoney: app.newTotal,
                logisticsFee: app.logisticsFee,
                payChannel: app.pay,
                orderItemDtos: api.pageParam.prescribeDrugs,
                doctorId: $api.getStorage("emp").userId,
                doctor: $api.getStorage("emp").realname,
                department: $api.getStorage('doctor').department,
                userName: app.address_total.name,
                userPhone: app.address_total.phone,
                userId: api.pageParam.userId,
                deductPoints:app.needPoint,
                deductPointMoney:app.deductionAmount
            };
            //console.log(JSON.stringify(o));return
            post_ajax("order/save", {
                planType: "agency_buy",
                addressId: app.address_total.id,
                addressPhone: app.address_total.phone,
                addressConsignee: app.address_total.name,
                addressDetail: app.address_total.areaInfo + app.address_total.address,
                dosageForm: app.dosagePingyin,
                storeId: api.pageParam.storeId,
                storeName: api.pageParam.store,
                storeLogo: api.pageParam.storeLogo,
                planId: api.pageParam.planId,
                prescription: String(app.prescription),
                visible: api.pageParam.visible,
                billingMoney: api.pageParam.billingMoney,
                serviceMoney: api.pageParam.serviceMoney,
                drugMoney: api.pageParam.drugMoney,
                decoctingFee: app.daijian_price,
                processCost: app.servicePrice,
                quantity: app.quantity,
                totalMoney: app.newTotal,
                logisticsFee: app.logisticsFee,
                payChannel: app.pay,
                orderItemDtos: api.pageParam.prescribeDrugs,
                doctorId: $api.getStorage("emp").userId,
                doctor: $api.getStorage("emp").realname,
                department: $api.getStorage('doctor').department,
                userName: app.address_total.name,
                userPhone: app.address_total.phone,
                userId: api.pageParam.userId,
                deductPoints:app.needPoint,
                deductPointMoney:app.deductionAmount
            }, function (res, err) {
                if (res.code == 200) {
                    toast("购药成功，请通知患者支付订单")
                    return
                }
            })
        }
    }


    function get_moren_dizhi() {
        get_ajax("ucenter/address/default", {
            userId: api.pageParam.userId
        }, function (res, err) {
            if (res && res.code == 200) {
                // alert(JSON.stringify(res))
                app.address_total = res.data
                getLogisticsFee()
            } else {
                app.logisticsFee = 0;
                app.address_total = ""
            }
        })
    }

    function getLogisticsFee() {
        get_ajax("store/order/logistics-fee", {
          provinceId: app.address_total.province,
          storeId:app.storeId
        }, function (res, err) {
            if (res && res.code == 200) {
                // alert(JSON.stringify(res))
                app.logisticsFee = res.data;
                if (Number(app.totalDrugsMoney) < 80) {
                    app.payAmount = res.data ? $api.toThreeDecimal(Number(res.data) + Number(api.pageParam.totalMoney)) : Number(api.pageParam.totalMoney);
                } else {
                    app.logisticsFee = 0;
                    app.payAmount = Number(api.pageParam.totalMoney);
                }
                //积分抵扣
                get_ajax("order/point-calculation",{
                  userId:api.pageParam.userId,
                  price: app.payAmount
                },function(rst,err){
                  if(rst.code == 200 && rst.data){
                    if(Number(rst.data.userPoint) >= Number(rst.data.needPoint)){
                      app.actualPayAmount = $api.toThreeDecimal(Number(app.payAmount) - Number(rst.data.deductionAmount))
                      app.actualPayAmount = app.actualPayAmount < 0 ? 0 : app.actualPayAmount
                      app.needPoint = rst.data.needPoint
                    }else{
                      app.actualPayAmount = Number(app.payAmount)
                      app.needPoint = 0
                    }
                    app.userPoint = rst.data.userPoint
                    app.deductionAmount = rst.data.deductionAmount
                    app.showNeedPoint = rst.data.needPoint
                  }
                });
            } else {
                // alert("网络不通畅，请稍后再试！")
                // alert("该患者无默认地址，请先通知他添加一个默认地址再为他购药吧")
                app.logisticsFee = 0;
                app.payAmount = Number(api.pageParam.totalMoney);
                //积分抵扣
                get_ajax("order/point-calculation",{
                  userId:api.pageParam.userId,
                  price: app.payAmount
                },function(rst,err){
                  if(rst.code == 200 && rst.data){
                    if(Number(rst.data.userPoint) >= Number(rst.data.needPoint)){
                      app.actualPayAmount = $api.toThreeDecimal(Number(app.payAmount) - Number(rst.data.deductionAmount))
                      app.actualPayAmount = app.actualPayAmount < 0 ? 0 : app.actualPayAmount
                      app.needPoint = rst.data.needPoint
                    }else{
                      app.actualPayAmount = Number(app.payAmount)
                      app.needPoint = 0
                    }
                    app.userPoint = rst.data.userPoint
                    app.deductionAmount = rst.data.deductionAmount
                    app.showNeedPoint = rst.data.needPoint
                  }
                });
            }
        })
    }
    function get_store_service() {
        get_ajax("store/service/service-price", {
            storeId: app.storeId,
            typeId: app.typeId
        }, function (res, err) {
            if (res.code == 200) {
                var conditions = res.data.conditions ? res.data.conditions : "";
                var servicePrice = res.data.price ? res.data.price : 0;
                app.djServicePrice = servicePrice;
                if (conditions) {
                    if (typeof conditions.support_dj != undefined) {
                        app.ifdaijian = conditions.support_dj == 1 ? true : false;
                        app.ifservice = false;
                        app.djServicePrice = conditions.support_dj == 1 ? servicePrice : 0;
                        app.servicePrice = 0
                        app.newTotal = Number(servicePrice) + Number(app.total_money);//缺少条件判断后期修改
                    } else {
                        app.newTotal = Number(servicePrice) + Number(app.total_money);//缺少条件判断后期修改
                        app.ifdaijian = false;
                        app.ifservice = true;
                        app.djServicePrice = 0;
                        app.servicePrice = servicePrice;
                    }
                } else {
                    app.servicePrice = 0;
                    app.ifservice = false;
                    app.ifdaijian = false;
                    app.djServicePrice = 0;
                }
                app.conditions = conditions;
            }
        })
    }

    function get_store_info() {
        get_ajax("store/view", {
            id: app.storeId
        }, function (res, err) {
            if (res.code == 200) {
                app.introduce = res.data.introduce;
            }
        })
    }


    // 检测是否支付
    function checked_order(id) {
        get_ajax("order/findOrderDetailByUserId", {
            userId: api.pageParam.userId,
            orderId: id
        }, function (res, err) {
            if (res.code == 200) {
                // alert(JSON.stringify(res.data.orderStatus))
                if (res.data.orderStatus == 1) {
                    toast("并未查询到您的付款记录")
                } else {
                    alert("付款成功！")
                    // api.closeWin()
                    api.openWin({
                        name: "order_list_win",
                        url: "order_list_win.html",
                    })
                }
            }
        })
    }
</script>
